<template>
  <div class="goodslistitem">
     <div>
     <img v-lazy="goodslistitem.show.img" @load="loadimg" @click="goodslisten"> 
     </div>
     <div class="goodscontent">
      <div><p>{{goodslistitem.title}}</p></div>
       <span class="price">{{goodslistitem.price+'￥'}}</span>
       <span class="collect">{{goodslistitem.cfav}}</span>   
     </div>
  </div>
</template>

<script>
export default {
  props:{
    goodslistitem:Object,
    default(){
      return {}
    }
  },
  name:'goodslist',
  methods: {
    loadimg(){
      this.$bus.$emit('loaditemimg') 
      // console.log(this.$bus)  
    },
    goodslisten(){
      // this.$emit('goodslisten')
      // this.$router.push('/details/'+this.goodslistitem.iid)
      this.$router.push({
        path:'/details',
        query:{
           iid:this.goodslistitem.iid
        }
      })
    }
  }
}
</script>

<style scoped>
   .goodslistitem{
    width: 150px;
   }
  .goodslistitem img{
    width: 42vw;
    height: 200px;
    border-radius: 5px;
    margin-bottom: 3px;
  }
  .goodscontent p{
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  font-weight: bolder;
  }
  .goodscontent div{
    margin: 5px;
    width: 42vw;
    height: 14px;  
  }
  .price{
    color:var(--color-text);
    font-size:14px;
    margin-right:5px;
  }
  .collect::before{
    display: inline-block;
    width:16px;
    height:16px;
    background-image: url('~assets/img/detail/icon03.png');
    content: '';
  }
 .collect{
   font-size: 14px;
 }
 .goodscontent{
   margin-bottom: 5px;
 }
</style>